home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.2 KB | 30 lines | [TEXT/GEOL] |
- Item 5839226 24-April-89 10:56
-
- From: PASCOE1 Pascoe, Geoff
-
- To: MACAPP.TECH$ MACAPP Tech
-
- Sub: Rekindling Lock/Unlock, etc.
-
- I've use both techniques of of keeping a lock count and reference count on
- objects.
-
- The lock count-
- I agree that if lock/unlock is implemented, it should entail a lock count.
- However, I'm ambivalent as to whether this belongs in the MacApp release. I
- use Lock/Unlock to lock a handle (not the object itself) that is one of the
- instance variables of the lock. Implementing without a lock count is
- potentially dangerous, implementing it with a lock count adds overhead to EVERY
- object. I'd just as soon leave it as a recipe.
-
- The reference count-
- I've used this technique also. It can be useful, if used sparingly in a
- design where acquiring and releasing objects occurs in only a few places and is
- tightly controlled. In my work, I only use this on a particular class (and
- subclass) of objects and its only used in a few places. Trying to use this as
- a substitute for REAL garbage collection is a BAD idea and it doesn't belong in
- MacApp. Again, I suggest a recipe.
-
- Geoff
-
-